<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <label><input id="one" type="text" name="one" placeholder="请输入第一个数"></label>
    <select id="FuHao">
        <option>+</option>
        <option>-</option>
        <option>*</option>
        <option>/</option>
    </select>
    <label><input id="two" placeholder="请输入第二个数"></label>
    <span>=</span>
    <!--    <label><input id="subtract" ></label>-->
    <!--    <label><input id="multiply" ></label>-->
    <!--    <label><input id="except" ></label>-->
    <label><input id="result"></label>
    <button type="button" id="btn">计算</button>
</head>
<body>
<script>
    onload = () => {
        let one = document.querySelector('#one');
        let two = document.querySelector('#two');
        let Fuhao = document.querySelector('#Fuhao');
        let result = document.querySelector('#result');
        let btn = document.querySelector('#btn');
        one.focus();
        btn.onclick = () => {
            let numA=parseInt(one.value);
            let numB=parseInt(two.value);
            if (one.value === null || one.value === '') {
                alert("您第一个输入框不能为空！");
                one.focus();
                return;
            }
            if (two.value === null || two.value === '') {
                alert("您第二个输入框不能为空！");
                two.focus();
                return;
            }
            result.value=
                '+'===Fuhao.value?numA+numB:
                 '-'===Fuhao


        }

    }
</script>
</body>
</html>